WimpScroll module

WimpScroll - Technical backgrounds |

WIMPScroll is a small application module that allows the use of a wheel mouse on any RISC OS machine using RISC OS 3.50 or higher. It allows scrolling of the window currently under the mouse, provided the window has a vertical scroll bar. It is NOT neccessary to slect the window first (i.e. get the input focus), so it will work on all scrollable windows, including the filer and long menus (e.g. the font menu).

How does it work? |

WIMPScroll is implemented as a module task. The module may be loaded from the PreDesk directory and hence may be resident in memory even before the WIMP is started. For this reason it will 'sleep' until it receives a service call that the WIMP is starting. When this happens, it will claim PointerV in order to receive new information about the wheel and any extra buttons on the PS2 mouse. It will also create an invisible window that is placed behind all other windows. This is used to allow scanning of the window stack when trying to find the parent of a window (in case the current window has no vertical scroll bar and is a pane inside another window that does have a scrol bar). Horizontal scrolling is also possible for windows that have a horizontal scroll bar, although there aren't that many mice with a horizontal scroll wheel.

PointerV |

When the mouse wheel is moved or when any of the extra buttons is pressed, the PS2 driver issues an event at PointerV. From version 1.10 of the WIMPScroll module onwards, this has been allocated as Reason Code 9. As WIMPScroll has subscribed itself to PointerV, it will receive the data, which it will then store in its private workspace. When issueing a PointerV 9 call, the registers will be setup as follows: r0 : 9 (Reason code) r1 : Vertical wheel movement r2 : Extra button state r3 : Horizontal wheel movement r4 : Reserved The movement registers (r1 and r3) will give the displacement (i.e. the number of pulses) since the last poll. Horizontal movement will only be used for mice with a 2nd wheel. The extra buttons in r2 represent any extra buttons besides the 3 standard buttons (select, menu and adjust). One bit is used for each button, starting with bit 0 (zero). Note: Please note that when using WimpScroll in combination with a PS2 mouse (i.e. on pre-RISC OS 5 machines) the effect of the horizontal scroll wheel and any additional buttons cannot be guaranteed. As there is no official standard for such features in the PS2 domain, the results may be unpredictable. Using WimpScroll with USB devices generally works fine.

Commands |

A number of *-commands have been implemented in the WIMPScroll module to allow customisation in certain areas. All *-commands start with the prefix 'WS' (for WimpScroll) to prevent name clashed with other modules. [/] This command is used internally by RISC OS to initialise the WIMP task as and when the Desktop is started. The command should not be issued by the user. [/] This command can be used to reverse the effect of the wheel movement. When set to '0' the wheel would scroll a window as expected. Setting it to '1' will reverse the effect. [/] This command is used to set the scrolling method used by default. <scrolltype> 0 : Part of visible area (1/4 by default) 1 : Generate Up/down key events [/] By default the same scrolling method is used for all tasks encountered by WIMPScroll, as set by the WSScrollType command (0 by default). WSTaskMap can be used to create a list of tasks with a different scrolling method.

Releated subjects |

WimpKey module The Scroll wheel window Main index

| © Copyright Paul Reuvers X-Ample Technology bv usb@xat.nl Last changed: Last changed: Thursday, 12 August 2004 - 16:16 CET.